package com.penfei.springrun.util;


public class MD5Util {

    @Deprecated
    public static String  md5(String src){

//        return DigestUtils.md5Hex(src);
        return "";
    }


    private static  final  String salt="1a2b3c4d";
    public static String inputPassFromPass(String inputPass){
       String str ="" +salt.charAt(0)+salt.charAt(2)+inputPass+salt.charAt(5)+salt.charAt(4);

       return md5(str);
    }


    public static String fromPassToDBFromPass(String fromPass,String salt){
        String str ="" +salt.charAt(0)+salt.charAt(2)+fromPass+salt.charAt(5)+salt.charAt(4);

        return md5(str);
    }

    public static String inputPassToDbPass(String input,String saltDB){
        String formPass=inputPassFromPass(input);
        String dbPass=fromPassToDBFromPass(formPass,saltDB);

        return dbPass;
    }


    public static  void main(String args[]){
        System.out.println(inputPassToDbPass("123321","1a2b3c4d"));
    }

}
